package iit.projects.etaxi.model.service;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import iit.projects.etaxi.model.dao.OperatorDao;
import iit.projects.etaxi.model.entity.Operator;

@Transactional(readOnly=true)
public class OperatorServiceImpl implements OperatorService {

	private OperatorDao operatorDao;
	
	@Override
	public Operator findByUserName(String username) {
		return operatorDao.findByUserName(username);
	}
	
	@Override
	@Transactional(readOnly=false, propagation=Propagation.REQUIRES_NEW)
	public Operator updateOperator(Operator operator){
		return operatorDao.updateOperator(operator);
	}

	public void setOperatorDao(OperatorDao operatorDao) {
		this.operatorDao = operatorDao;
	}

}
